package com.metering.purchaseServerCommon.common.bean.exception;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.metering.purchaseServerCommon.common.bean.util.R;

@RestControllerAdvice
public class CommonExceptionHandler {
	 /**
     * a全局异常捕捉处理
     * @param ex
     * @return
     */
    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    R exception(Exception e) {
        return R.error(500, e.getMessage());
    }
}
